/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.tnmk.worktime.exception;

import java.util.Map;
import org.tnmk.worktime.service.dao.DataTable;

/**
 *
 * @author Administrator
 */
public class NotFoundTableException extends RuntimeException{
  private Class tableClass;
  private Map<Class,DataTable> storage;
  public NotFoundTableException(Class tableClass, Map<Class,DataTable> storage){
    super();
    this.tableClass = tableClass;
    this.storage = storage;
  }
  @Override
  public String getMessage(){
    StringBuilder sb = new StringBuilder("Cannot find table ")
    .append(tableClass.getSimpleName()).append(" in storage ").append(this.storage.keySet())
    .append("\n")
    .append(super.getMessage());
    return sb.toString();
  }
}
